import { notice, warn_level, warn_source, is_handled } from '@/plugins/mate.js'
export const formConfig = [
    {
        name: 'device_name',
        type: 'input',
        placeholder: '设备名称',
    },
    {
        name: 'scope_id_list',
        type: 'cascader',
        placeholder: '筛选范围',
        options: [],
    },
    {
        name: 'start_time',
        type: 'date',
        placeholder: '开始时间',
    },
    {
        name: 'end_time',
        type: 'date',
        placeholder: '结束时间',
    },
    {
        name: 'status',
        type: 'select',
        placeholder: '是否处理',
        options: is_handled.options,
    },
]

export const config = [
    {
        name: 'title',
        type: 'input',
        placeholder: '请输入标题',
        label: '标题',
        required: true,
    },
    {
        name: 'pull_name',
        type: 'input',
        placeholder: '请输入推送人',
        label: '推送人',
        required: true,
    },
    {
        name: 'accept_name',
        type: 'input',
        placeholder: '请输入处理人',
        label: '处理人',
        required: true,
    },
    {
        name: 'content',
        type: 'input',
        placeholder: '请输入处理内容',
        label: '处理内容',
        required: true,
    },
]

export const column = [
    {
        label: '工单名称',
        name: 'title',
    },

    {
        label: '推送人',
        name: 'pull_name',
    },
    {
        label: '告警等级',
        name: 'warn_level',
        format: (val) => warn_level.dirc[val],
        color: (val) => warn_level.color[val],
    },
    {
        label: '处理人',
        name: 'accept_name',
    },

    {
        label: '处理内容',
        name: 'content',
    },
    {
        label: '是否处理',
        name: 'status',
        format: (val) => is_handled.dirc[val],
        color: (val) => (val == 2 ? '#f85726' : '#0cd9e8'),
    },
    {
        label: '最后告警',
        name: 'end_time',
        width: '220',
    },
    {
        title: '操作',
        name: 'action',
        width: '220',
        buttons: [
            {
                text: '查看',
                click: (val) => {},
            },
            {
                text: '删除',
                click: (val) => {},
            },
            {
                text: '处理',
                click: (val) => {},
            },
        ],
    },
]
